
<%@ include file="/common/taglibs.jsp"%>
<fmt:message key="headerSelection" scope="request" var="hs" />
<head>
    <title><fmt:message key="categoryDetail.title"/></title>
    <meta name="heading" content="<fmt:message key='categoryDetail.heading'/>"/>
    <meta name="menu" content="MaterialMenu"/>

    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/lang/calendar-es.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar-setup.js'/>"></script>

    <script type="text/javascript">

        function onFormSubmit(categoryForm) {
<c:if test="${param.from == 'productListRight'}">
        selectAll('productListRight');
</c:if>
    }
    </script>

</head>

<div>
    <s:form id="categoryForm" action="saveCategory" method="post" validate="true">
        <s:hidden name="category.id" value="%{category.id}"/>
        <s:textfield maxLength="60" key="category.name" required="true" cssClass="text medium" />
        <s:textfield maxLength="60" key="category.nameEs" required="true" cssClass="text medium" />
        <s:optiontransferselect
            listKey="value"
            listValue="label"
            list="productTypeListLeft"
            allowSelectAll="true"
            selectAllLabel="Select all"
            doubleListKey="value"
            doubleListValue="label"
            doubleName="productTypeOptionsPicked"
            doubleList="productTypeListRight"
            />

        <li class="buttonBar bottom">
            <s:submit cssClass="button" method="save" key="button.save" theme="simple"/>
            <c:if test="${not empty category.id}">
                <s:submit cssClass="button" method="delete" key="button.delete" onclick="return confirmDelete('category')" theme="simple"/>
            </c:if>
            <s:submit cssClass="button" method="cancel" key="button.cancel" theme="simple"/>
        </li>

    </s:form>
</div>
<script type="text/javascript">
    Form.focusFirstElement($("categoryForm"));
    document.getElementById('divFeatureCategory').style.top = document.getElementById('categoryForm').offsetTop+"px";

</script>
